$(function() {

    $("body").css("opacity","1")

    var username = localStorage.getItem("username");
    $("#mimatijiao").click(function () {

        var mima1 = $("#xinmima").val();
        var mima2 = $("#cfmima").val();
        if(mima1 == mima2)
        {
            $.post("/xjxt/mimaxiugai", {
                "username": username,
                "password": $("#nowmima").val(),
                "xinmima": mima1
            }, function (res) {
                if (res == "2") {
                    alert("修改失败，请检查输入密码");
                    window.location.reload()
                }
                if (res == "1") {
                    alert("修改成功");
                    window.location.reload()
                }
                if (res == "3") {
                    alert("后台修改失败");
                    window.location.reload()
                }

            });
        }
        else {
            alert("两次输入密码不一致请重新输入")
        }

    });

});